package com.example.jialei.testdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private Button btn_hello;
    private EditText et_name;
    private TextView tv_text;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {

        btn_hello = ((Button) findViewById(R.id.btn_hello));
        et_name = ((EditText) findViewById(R.id.et_name));
        tv_text = ((TextView) findViewById(R.id.tv_text));
        btn_hello.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv_text.setText("hello" + et_name.getText().toString());
            }
        });

    }

}
